interface Girl18 {
  name: string;
}
class SelectGirl18<T extends Girl18> {
  constructor(private girls: T[]) {}
  getGirl(index: number): string {
    return this.girls[index].name;
  }
}
class SelectGirl181<T extends number | string> {
  constructor(private girls: T[]) {}
  getGirl(index: number): T {
    return this.girls[index];
  }
}

const selectGril18 = new SelectGirl18([
  { name: "dajia" },
  { name: "liuyan" },
  { name: "yifei" },
]);

console.log(selectGril18.getGirl(0));
